package org.q.job;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class CmdProcessor implements Job {

	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		ExecutorService pool = Executors.newFixedThreadPool(5);
		for(int i=0;i<5;i++) {
			try {
				pool.execute(new DetailParser());
			} catch (Exception e) {
				System.out.println("----------"+e.getMessage());
			}
		}
		pool.shutdown();
		try {
			pool.awaitTermination(Integer.MAX_VALUE, TimeUnit.DAYS);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

}
